<template>
  <a-config-provider :locale="zhCN">
    <AntdDesignForm :request="request" />
    <!-- <AntdGenerateForm ref="generateForm" :data="data" :value="value" /> -->
  </a-config-provider>
</template>
<script lang='ts'>
import { AntdDesignForm } from '../src'
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import { defineComponent, ref } from 'vue'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import request from './api/request'
dayjs.locale('zh-cn')
export default defineComponent({
  components: { AntdDesignForm },
  setup() {
    const data = ref({
      list: [
        {
          label: '下拉选择框',
          type: 'select',
          options: {
            defaultValue: 'Option 1',
            width: '200px',
            mode: null,
            placeholder: '',
            remote: false,
            showLabel: false,
            showSearch: false,
            clearable: false,
            disabled: false,
            props: {
              label: 'label',
              value: 'value'
            },
            options: [
              {
                label: 'Option 1',
                value: 'Option 1'
              },
              {
                label: 'Option 2',
                value: 'Option 2'
              },
              {
                label: 'Option 3',
                value: 'Option 3'
              }
            ],
            remoteOptions: [
              {
                label: 'Option 1',
                value: 'Option 1'
              }
            ],
            remoteFunc:
              'https://raw.githubusercontent.com/fuchengwei/vue-form-create/master/mock/mock.json',
            rules: {
              trigger: 'blur',
              enum: '',
              message: '',
              pattern: '',
              required: false,
              type: 'any'
            }
          },
          key: '2481088f78fa4d099a28165d8e4b825d',
          model: 'select_2481088f78fa4d099a28165d8e4b825d',
          rules: []
        }
      ],
      config: {
        size: 'default',
        hideRequiredMark: false,
        layout: 'horizontal',
        labelAlign: 'right',
        labelCol: {
          span: 3,
          offset: 0
        }
      }
    })
    const value = ref({
      select_2481088f78fa4d099a28165d8e4b825d: []
    })
    return {
      zhCN,
      data,
      value,
      request
    }
  }
})
</script>
